<template>
    <div class='myself'>
        <div class='backgroundC'></div>
        <comp-head :menu='"0"' :loadLogin='loadLogin'></comp-head>
        <el-menu
            :default-active="activeIndex2"
            class="el-menu-demo"
            mode="horizontal"
            @select="handleSelect"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b">
            <el-menu-item index="0">主站</el-menu-item>
            <el-menu-item index="1">我的视频</el-menu-item>
            <!-- <el-submenu index="2">
                <template slot="title">我的工作台</template>
                <el-menu-item index="2-1">选项1</el-menu-item>
                <el-menu-item index="2-2">选项2</el-menu-item>
                <el-menu-item index="2-3">选项3</el-menu-item>
                <el-submenu index="2-4">
                    <template slot="title">选项4</template>
                    <el-menu-item index="2-4-1">选项1</el-menu-item>
                    <el-menu-item index="2-4-2">选项2</el-menu-item>
                    <el-menu-item index="2-4-3">选项3</el-menu-item>
                </el-submenu>
            </el-submenu> -->
            <el-menu-item index="2" v-show='false'>我的回复</el-menu-item>
            <el-menu-item index="5">我的收藏</el-menu-item>
            <el-menu-item index="3" v-if='user.level >= 4'>我要上传</el-menu-item>
            <el-menu-item index="4" v-if='user.level >= 5'>审核权限</el-menu-item>
        </el-menu>
        <comp-video ref='videoList' v-show='activeIndex2 == 1'></comp-video>
        <comp-update v-show='activeIndex2 == 3' :saveLoad='videoSaveLoad'></comp-update>
        <comp-check v-if='activeIndex2 == 4'></comp-check>
        <comp-collect v-show='activeIndex2 == 5'></comp-collect>
  </div>
</template>

<script>
import compHead from "../head/head"
import compVideo from "./comp/mvideo"
import compCollect from "./comp/mcollect"
import compCheck from "./comp/check"
import compUpdate from "../updateFile/updateFileV"
import { mapGetters } from 'vuex'
export default {
    components: {
        compHead,
        compVideo,
        compUpdate,
        compCheck,
        compCollect
    },
    data (){
        return {
            activeIndex2: "1",
            user: {}
        }
    },
    // computed: {
	// 	...mapGetters(["user"]) 
	// },
    methods: {
        handleSelect (value){
            if( value == "0" ){
                // 如果是首页
                this.$router.push("/");
                return;
            }
            this.activeIndex2 = value;
        }, 
        videoSaveLoad (){
            this.activeIndex2 = "1";
            this.$refs.videoList.getVideoListByMasterId();
        },
        loadLogin (user){
            this.user = user;
        }
    }
}
</script>

<style scoped>
    .myself {
        position:relative;
        width: 80%;
        margin: auto;
    }

    .backgroundC {
        background-image: url(~@/assets/images/bg1.jpg) !important;
        /* background-image: url(~@/assets/images/bg.jpg) !important; */
        position: fixed;
        background-repeat: no-repeat;
        top: 0;
        left: 0;
        z-index: 0;
        overflow: hidden;
        width: 100%;
        height: 100%;
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
        opacity: 0.85;
    }

</style>